

clear
use ${data}Simulation/sim_data.dta 
forv d=1/3 {
merge m:1 schoolpos_id using  ${data}Simulation/optimal_taus`d'_o8_bs0.dta, nogen update
}

keep if groupDay_seq==1

keep  group intDay tau*star 


foreach var of varlist tau* {
	local newvar = subinstr("`var'","_star","",1)
	ren `var' `newvar'
}

reshape long tau, i(group intDay) j(round)

egen group2 = group(group intDay)
tsset group2 round

	
forv g=1/6 {
	
	graph twoway  (tsline tau if group==`g' & intDay==1, lcolor(black) lpattern(solid)) (tsline tau if group==`g' & intDay==2, lcolor(black) lpattern(dash))    (tsline tau  if group==`g' & intDay==3, lcolor(black) lpattern(dot)),  ///
		xlabel(1(1)7, nogrid) ylabel(,nogrid) xtitle("Round") ytitle("Threshold") ///
		legend(order(1 "Day 1" 2 "Day 2" 3 "Day 3")  pos(6) col(3))
	graph export ${results}figureA1_g`g'.png, replace
}


/* Group Definitions
1. Hispanic, Other Subject
2. Hispanic, STEM
3. Hispanic, SPED
4. Black, Other Subject
5. Black, STEM
6. Black, SPED
*/

exit
